<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition  xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./../template/studentTemplate.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui">
    <ui:define name="title">
        Student profile
    </ui:define>
    <ui:define name="content1">
        <!--        <h:outputScript library="primefaces" name="jquery/jquery.js" />-->
        
        <div class="col-6 col-lg-6 col-sm-6">
            <h:form >
                <div class="form-group">
                    <div class="col-2">User name</div>
                    <div class="input-group ">
                        <span class="input-group-addon">@</span>
                        <h:outputText value="#{studentBean.userName}" styleClass="form-control"/>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-2">Full name</div>
                    <div class="input-group ">
                        <span class="input-group-addon">@</span>
                        <h:inputText value="#{studentBean.fullName}" styleClass="form-control"/>
                    </div>
                </div>


                <div class="form-group">
                    <div class="col-2">Birthday</div>
                    <div class="input-group ">
                        <span class="input-group-addon">@</span>
                        <h:inputText value="#{studentBean.birthday}" class="form-control c1 pl" alt="Birthday dd-mm-yyyy">
                            <f:convertDateTime type="date" pattern="dd-MM-yyyy" timeZone="GMT+7"/>
                        </h:inputText>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-2">Address</div>
                    <div class="input-group ">
                        <span class="input-group-addon">@</span>
                        <h:inputText value="#{studentBean.address}" styleClass="form-control"  />
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-2">Email</div>
                    <div class="input-group ">
                        <span class="input-group-addon">@</span>
                        <h:inputText value="#{studentBean.email}" styleClass="form-control"  />
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-2">Gender</div>
                    <div class="input-group ">
                        <h:selectOneMenu value="#{studentBean.gender}" styleClass="form-control">
                            <f:selectItems value="#{genders.all}" var="g" itemLabel="#{g.dispayString}" itemValue="#{g.value}"                                           />
                        </h:selectOneMenu>
                    </div>
                </div>              
                <div class="form-group">
                    <p:fileUpload fileUploadListener="#{studentBean.upload}" mode="advanced" dragDropSupport="false"  
                                  update="messages1" sizeLimit="1000000"  allowTypes="/(\.|\/)(gif|jpe?g|png)$/" />  

                    <p:growl id="messages1" showDetail="true"/> 
                </div>
                <p>Choose files to attach (not larger than 5MB per file ): </p>
                <div class="form-group">
                    <div class="">
                        <h:commandButton value="Update" action="#{studentBean.doupdate}" styleClass="btn btn-default"></h:commandButton>
                        <input type="reset" class="btn btn-default" value="Reset" />
                    </div>
                </div>
            </h:form>
        </div>
    </ui:define>

</ui:composition>
